import { MockMethod } from "vite-plugin-mock";
export default [
  // 用户信息
  {
    url: "/api/system/userlist",
    method: "post",
    response: () => {
      return {
        code: 200,
        message: "成功",
        data: {
          total: "@integer(100, 200)", // 总记录数
          "records|20": [
            {
              //生成20条数据
              "id|+1": 1, //初始值1开始，每条+1
              username: "@word(10)", // 用户帐号
              "password|6": "*", // 密码，均为隐藏*号
              nickName: "@cname", // 用户昵称
              mobile: /1\d{10}/, //正则表达式
              "roleIds|1": [
                // 不要使用 [1, 2, 3] 因为这样返回的是数字1，而不是返回数组[1]
                [1],
                [1, 2],
                [3],
              ], // 拥有角色ids
              email: "@email()",
              imageUrl:
                "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80",
              remark: "@ctitle",
              "accountNonExpired|1": true, // 帐号是否过期(true 未过期，false已过期) 生成 true 或 false 概率都是 1/2
              "accountNonLocked|1": true, // 帐户是否被锁定(true 未锁定，false已锁定)
              "credentialsNonExpired|1": true, // 密码是否过期(true  未过期，false已过期)
              createTime: "@datetime",
              updateTime: "@datetime",
            },
          ],
        },
      };
    },
  },
  // 删除用户
  {
    url: "/api/system/user",
    method: "get",
    response: () => {
      return {
        code: 200,
        message: "删除成功",
        data: true,
      };
    },
  },
  // 角色列表
  {
    url: "/api/system/role/list",
    method: "post",
    response: () => {
      return {
        code: 200,
        message: "成功",
        data: {
          total: "@integer(100,200)", // 总记录数
          "records|200": [
            {
              //生成20条数据
              "id|+1": 1, //初始值1开始，每条+1
              "roleName|1": ["超级管理员", "前端主管", "后端主管", "产品主管"],
              roleCode: "ROLE_" + "@word(5)", // ROLE_5个英文字符
              "status|10-2": true, // Boolean, 生成 true 概率 10/(10+2), false 概率 2/(10+2)
              remark: "@ctitle",
              createTime: "@date", // 随机创建时间
              updateTime: "@date", // 随机更新时间
            },
          ],
        },
      };
    },
  },
  // 用户列表
  {
    url: "/api/system/user/edit",
    method: "get",
    response: () => {
      return {
        code: 200,
        message: "修改成功",
        data: true,
      };
    },
  },
  // 删除
  {
    url: "/api/system/role",
    method: "get",
    response: () => {
      return {
        code: 200,
        message: "删除成功",
        data: true,
      };
    },
  },
  // 菜单下拉
  {
    url: "/api/system/menu/select",
    method: "get",
    response: () => {
      return {
        code: 200,
        message: "删除成功",
        data: [
          {
            id: "1111",
            parentId: null,
            title: "首页",
            children: [],
          },
          {
            id: "2222",
            parentId: null,
            title: "系统管理",
            children: [
              {
                id: "22221",
                parentId: "2222",
                title: "菜单管理",
                children: [],
              },
              {
                id: "22222",
                parentId: "2222",
                title: "角色管理",
                children: [],
              },
              {
                id: "22223",
                parentId: "2222",
                title: "用户管理",
                children: [],
              },
            ],
          },
          {
            id: "4444",
            parentId: null,
            title: "云涵官网",
            children: [],
          },
        ],
      };
    },
  },
  {
    url: "/api/system/menu/list",
    method: "get",
    response: () => {
      return {
        code: 200,
        message: "查询成功",
        data: [
          {
            id: "1111",
            parentId: null,
            type: "1",
            path: "/home",
            name: "Home", // 路由名称
            code: "home", // 权限标识
            redirect: null,
            component: "home/index.vue", // 不要写 @/views/
            meta: {
              title: "首页",
              icon: "ele-HomeFilled",
              cache: true,
              hidden: false,
              isBreadcrumd: true,
            },
            sort: 1,
            remark: "@ctitle",
            createTime: "@date",
            updateTime: "@date",
            children: [],
          },
          {
            id: "2222",
            parentId: null,
            type: "1",
            path: "/system",
            name: "System",
            code: "system",
            redirect: "/system/menu",
            component: null,
            meta: {
              title: "系统管理",
              icon: "ele-Setting",
              cache: true,
              hidden: false,
              isBreadcrumd: true,
            },
            sort: 2,
            remark: "@ctitle",
            createTime: "@date",
            updateTime: "@date",
            children: [
              {
                id: "22221",
                parentId: "2222",
                type: "1",
                path: "/system/menu",
                name: "SystemMenu",
                code: "system:menu",
                redirect: null,
                component: "system/menu/index.vue",
                meta: {
                  title: "菜单管理",
                  icon: "ele-Menu",
                  cache: true,
                  hidden: false,
                  isBreadcrumd: true,
                },
                sort: 1,
                remark: "@ctitle",
                createTime: "@date",
                updateTime: "@date",
                children: [
                  {
                    id: "222211",
                    parentId: "22221",
                    type: "2", // 2 操作按钮
                    path: null,
                    name: null,
                    redirect: null,
                    code: "system:menu:search",
                    meta: {
                      title: "查询列表",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 1,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                  {
                    id: "222212",
                    parentId: "22221",
                    type: "2",
                    path: null,
                    name: null,
                    redirect: null,
                    code: "system:menu:add",
                    meta: {
                      title: "新增菜单",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 2,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                  {
                    id: "222213",
                    parentId: "22221",
                    type: "2",
                    path: null,
                    name: null,
                    redirect: null,
                    code: "system:child:add",
                    meta: {
                      title: "新增下级",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 3,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                  {
                    id: "222214",
                    parentId: "22221",
                    type: "2",
                    name: null,
                    path: null,
                    redirect: null,
                    code: "system:menu:edit",
                    meta: {
                      title: "修改菜单",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 4,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                  {
                    id: "222215",
                    parentId: "22221",
                    type: "2",
                    name: null,
                    path: null,
                    redirect: null,
                    code: "system:menu:delete",
                    meta: {
                      title: "删除菜单",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 5,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                ],
              },
              {
                id: "22222",
                parentId: "2222",
                type: "1",
                path: "/system/role",
                name: "SystemRole",
                code: "system:role",
                redirect: null,
                component: "system/role/index.vue",
                meta: {
                  title: "角色管理",
                  icon: "ele-IceCream",
                  cache: true,
                  hidden: false,
                  isBreadcrumd: true,
                },
                sort: 2,
                remark: "@ctitle",
                createTime: "@date",
                updateTime: "@date",
                children: [
                  {
                    id: "222221",
                    parentId: "22222",
                    type: "2",
                    name: null,
                    path: null,
                    redirect: null,
                    code: "system:role:search",
                    meta: {
                      title: "查询角色",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 1,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                  {
                    id: "222222",
                    parentId: "22222",
                    type: "2",
                    name: null,
                    path: null,
                    redirect: null,
                    code: "system:role:add",
                    meta: {
                      title: "新增角色",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 2,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                  {
                    id: "222223",
                    parentId: "22222",
                    type: "2",
                    name: null,
                    path: null,
                    redirect: null,
                    code: "system:role:edit",
                    meta: {
                      title: "修改角色",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 3,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                  {
                    id: "222224",
                    parentId: "22222",
                    type: "2",
                    name: null,
                    path: null,
                    redirect: null,
                    code: "system:role:delete",
                    meta: {
                      title: "删除角色",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 4,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                  {
                    id: "222225",
                    parentId: "22222",
                    type: "2",
                    name: null,
                    path: null,
                    redirect: null,
                    code: "system:role:menu",
                    meta: {
                      title: "分配权限",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 5,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                ],
              },
              {
                id: "22223",
                parentId: "2222",
                type: "1",
                path: "/system/user",
                name: "SystemUser",
                code: "system:user",
                redirect: null,
                component: "system/user/index.vue",
                meta: {
                  title: "用户管理",
                  icon: "ele-User",
                  cache: true,
                  hidden: false,
                  isBreadcrumd: true,
                },
                sort: 3,
                remark: "@ctitle",
                createTime: "@date",
                updateTime: "@date",
                children: [
                  {
                    id: "222231",
                    parentId: "22222",
                    type: "2",
                    path: null,
                    name: null,
                    redirect: null,
                    code: "system:user:search",
                    meta: {
                      title: "查询用户",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 1,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                  {
                    id: "222232",
                    parentId: "22222",
                    type: "2",
                    path: null,
                    name: null,
                    redirect: null,
                    code: "system:user:add",
                    meta: {
                      title: "新增用户",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 2,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                  {
                    id: "222233",
                    parentId: "22222",
                    type: "2",
                    path: null,
                    name: null,
                    redirect: null,
                    code: "system:user:edit",
                    meta: {
                      title: "修改用户",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 3,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                  {
                    id: "222234",
                    parentId: "22222",
                    type: "2",
                    path: null,
                    name: null,
                    redirect: null,
                    code: "system:user:delete",
                    meta: {
                      title: "删除用户",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 4,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                  {
                    id: "222236",
                    parentId: "22222",
                    type: "2",
                    path: null,
                    name: null,
                    redirect: null,
                    code: "system:user:password",
                    meta: {
                      title: "密码重置",
                      icon: null,
                      cache: true,
                      hidden: true,
                    },
                    sort: 6,
                    remark: "@ctitle",
                    createTime: "@date",
                    updateTime: "@date",
                    children: [],
                  },
                ],
              },
            ],
          },
          {
            id: "4444",
            parentId: null,
            type: "1",
            path: "/mengxuegu",
            name: "yunhan", // 路由名称
            code: "yunhan", // 权限标识
            redirect: null,
            component: "link/index.vue",
            meta: {
              title: "云涵官网",
              icon: "ele-Link",
              linkTo: "https://www.baidu.com", // 外链跳转地址
              cache: true,
              hidden: false,
              isBreadcrumd: true,
            },
            sort: 4,
            remark: "@ctitle",
            createTime: "@date",
            updateTime: "@date",
            children: [],
          },
        ],
      };
    },
  },
  {
    url: "/api/system/company/list",
    method: "get",
    response: () => {
      return {
        code: 200,
        message: "查询成功",
        data: [
          {
            name: "云涵科技",
            parentId: 0,
            username: "云涵",
            sort: 0,
            phone: "15888888888",
            email: "ry@qq.com",
            status: 0,
            id: 100,
            createTime: 1609837427000,
            children: [
              {
                name: "重庆总公司",
                parentId: 100,
                username: "嬴政",
                sort: 1,
                leaderUserId: 104,
                phone: "15888888888",
                email: "ry@qq.com",
                status: 0,
                id: 101,
                createTime: 1609837427000,
                children: [
                  {
                    name: "研发部门",
                    parentId: 101,
                    username: "李世民",
                    sort: 1,
                    leaderUserId: 104,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 103,
                    createTime: 1609837427000,
                  },
                  {
                    name: "市场部门",
                    username: "朱元璋",
                    parentId: 102,
                    sort: 1,
                    leaderUserId: null,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 108,
                    createTime: 1609837427000,
                  },
                ],
              },
              {
                name: "长沙分公司",
                parentId: 100,
                username: "孙权",
                sort: 2,
                leaderUserId: null,
                phone: "15888888888",
                email: "ry@qq.com",
                status: 1,
                id: 102,
                createTime: 1609837427000,
                children: [
                  {
                    name: "市场部门",
                    parentId: 101,
                    username: "曹操",
                    sort: 2,
                    leaderUserId: null,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 104,
                    createTime: 1609837427000,
                  },
                  {
                    name: "财务部门",
                    username: "诸葛亮",
                    parentId: 102,
                    sort: 2,
                    leaderUserId: null,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 109,
                    createTime: 1609837427000,
                  },
                  {
                    name: "测试部门",
                    parentId: 101,
                    username: "魏骏涵",
                    sort: 3,
                    leaderUserId: null,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 105,
                    createTime: 1609837427000,
                  },
                  {
                    name: "财务部门",
                    username: "爱新觉罗",
                    parentId: 101,
                    sort: 4,
                    leaderUserId: 103,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 106,
                    createTime: 1609837427000,
                  },
                  {
                    name: "运维部门",
                    parentId: 101,
                    username: "谭满堂",
                    sort: 5,
                    leaderUserId: null,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 107,
                    createTime: 1609837427000,
                  },
                ],
              },
            ],
          },
        ],
      };
    },
  },
  // 组织下拉
  {
    url: "/api/system/company/select",
    method: "get",
    response: () => {
      return {
        code: 200,
        message: "查询成功",
        data: [
          {
            name: "云涵科技",
            parentId: 0,
            username: "云涵",
            sort: 0,
            phone: "15888888888",
            email: "ry@qq.com",
            status: 0,
            id: 100,
            createTime: 1609837427000,
            children: [
              {
                name: "重庆总公司",
                parentId: 100,
                username: "嬴政",
                sort: 1,
                leaderUserId: 104,
                phone: "15888888888",
                email: "ry@qq.com",
                status: 0,
                id: 101,
                createTime: 1609837427000,
                children: [
                  {
                    name: "研发部门",
                    parentId: 101,
                    username: "李世民",
                    sort: 1,
                    leaderUserId: 104,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 103,
                    createTime: 1609837427000,
                  },
                  {
                    name: "市场部门",
                    username: "朱元璋",
                    parentId: 102,
                    sort: 1,
                    leaderUserId: null,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 108,
                    createTime: 1609837427000,
                  },
                ],
              },
              {
                name: "长沙分公司",
                parentId: 100,
                username: "孙权",
                sort: 2,
                leaderUserId: null,
                phone: "15888888888",
                email: "ry@qq.com",
                status: 1,
                id: 102,
                createTime: 1609837427000,
                children: [
                  {
                    name: "市场部门",
                    parentId: 101,
                    username: "曹操",
                    sort: 2,
                    leaderUserId: null,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 104,
                    createTime: 1609837427000,
                  },
                  {
                    name: "财务部门",
                    username: "诸葛亮",
                    parentId: 102,
                    sort: 2,
                    leaderUserId: null,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 109,
                    createTime: 1609837427000,
                  },
                  {
                    name: "测试部门",
                    parentId: 101,
                    username: "魏骏涵",
                    sort: 3,
                    leaderUserId: null,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 105,
                    createTime: 1609837427000,
                  },
                  {
                    name: "财务部门",
                    username: "爱新觉罗",
                    parentId: 101,
                    sort: 4,
                    leaderUserId: 103,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 106,
                    createTime: 1609837427000,
                  },
                  {
                    name: "运维部门",
                    parentId: 101,
                    username: "谭满堂",
                    sort: 5,
                    leaderUserId: null,
                    phone: "15888888888",
                    email: "ry@qq.com",
                    status: 0,
                    id: 107,
                    createTime: 1609837427000,
                  },
                ],
              },
            ],
          },
        ],
      };
    },
  },
  // 字典分类列表
  {
    url: "/api/system/dict-type/list",
    method: "post",
    response: () => {
      return {
        code: 200,
        message: "成功",
        data: {
          total: "@integer(100,200)", // 总记录数
          "records|200": [
            {
              //生成20条数据
              "id|+1": 1, //初始值1开始，每条+1
              "name|1": [
                "性别",
                "菜单状态",
                "角色状态",
                "组织状态",
                "社交类型",
                "客户所属行业",
                "客户等级",
                "客户来源",
              ],
              type: "ROLE_" + "@word(5)", // ROLE_5个英文字符
              "status|1-2": 1, // Boolean, 生成 true 概率 10/(10+2), false 概率 2/(10+2)
              remark: "@ctitle",
              createTime: "@date", // 随机创建时间
            },
          ],
        },
      };
    },
  },
  // 字典数据列表
  {
    url: "/api/system/dict-data/list",
    method: "post",
    response: () => {
      return {
        code: 200,
        message: "成功",
        data: {
          total: "@integer(1,5)", // 总记录数
          "records|5": [
            {
              //生成20条数据
              "id|+1": 1, //初始值1开始，每条+1
              "label|1": [
                "上架",
                "下架",
                "男",
                "女",
                "1级",
                "2级",
                "3级",
                "4级",
              ],
              dictType: "ROLE_" + "@word(5)", // ROLE_5个英文字符
              "status|0-1": true, // Boolean, 生成 true 概率 10/(10+2), false 概率 2/(10+2)
              "value|1": [1, 2, 3, 4, 5, 6],
              remark: "@ctitle",
              createTime: "@date", // 随机创建时间
              "sort|+1": 1,
            },
          ],
        },
      };
    },
  },
] as MockMethod[];
